package cn.liyunqi.util;

import java.io.File;
import java.text.DecimalFormat;

public class TimeUtil {

    public static String fotmatDoubleToHMS(double len){

        int hour = (int) (len / 3600);

        int minutes = (int) ((len - hour * 3600)/60);

        double second = (len - hour * 3600 - minutes * 60);


        return (hour < 10?"0" + hour:hour + "") + ":" + (minutes < 10? "0" + minutes: minutes + "") + ":"  + new DecimalFormat("00.000").format(second);
    }
    public static String fotmatDoubleToMS(double len){

        int minutes = (int) ((len)/60);
        double second = (len - minutes * 60);

        return  (minutes < 10? "0" + minutes: minutes + "") + ":"  + new DecimalFormat("00.000").format(second);
    }

}
